<template>
	<view class="content">
		<uni-collapse accordion="true">
		    <uni-collapse-item title="增加题库的题目(题库最少为2题)" thumb="../../static/zengjia.png">
				<view class="title">设置题目所属题库：
					<input type="text" value="" placeholder="题库号 例如:1,2,3" @input="questionNum"/>
				</view>
				<view class="title">设置题目：
					<input type="text" value="" placeholder="请输入题目" @input="questiontitle"/>
				</view>
				<view class="title">设置选项：
					<input type="text" value="" placeholder="用逗号和点分割如:A.鱼,B.姜" @input="questionOption"/>
				</view>
				<view class="title">设置答案：
					<input type="text" value="" placeholder="请输入正确答案 例如	A,B" @input="questionResult" />
				</view>
				<view class="title">设置分数：
					<input type="text" value="" placeholder="请输入本题分值 例如:10" @input="questionScore"/>
				</view>
				<button @click="plus">增加</button>
		    </uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	import timeSelector from '../wing-time-selector/wing-time-selector.vue';
	import uniCollapse from '../../components/uni-collapse/uni-collapse.vue'
	import uniCollapseItem from '../../components/uni-collapse-item/uni-collapse-item.vue'
	import uniSection from '../../components/uni-section/uni-section.vue'
	export default{
		data() {
		    return {
			   dataList:{
				   questionNum:'',
				   questiontitle:'',
				   questionOption:'',
				   questionResult:'',
				   questionScore:''
			   }
		    }
		},
		methods: {
			questionNum: function(e){
				console.log(e.detail.value)
				this.dataList.questionNum = e.detail.value
			},
			questiontitle: function(e){
				console.log(e.detail.value)
				this.dataList.questiontitle = e.detail.value
			},
			questionOption: function(e){
				console.log(e.detail.value)
				this.dataList.questionOption = e.detail.value
			},
			questionResult: function(e){
				console.log(e.detail.value)
				this.dataList.questionResult = e.detail.value
			},
			questionScore: function(e){
				console.log(e.detail.value)
				this.dataList.questionScore = e.detail.value
			},
			plus(){
				this.$emit('func',JSON.stringify(this.dataList))
			}
		},
		components:{uniCollapse,uniCollapseItem,uniSection,timeSelector}
	}
</script>

<style lang="scss" scoped>
	view{
		width: 100%;
		font-size: 14px;
		text-align: left;
		background-color: #fff;
		// border-bottom: 2px solid #DDDDDD;
		line-height: 40px;
		button{
			width: 50%;
			font-size: 12px;
			background-color: #CCE6FF;
			margin: 10px auto;
		}
		input{
			width: 50%;
			border: 2px solid #CCE6FF;
			font-size: 12px;
			margin: 5px auto;
			text-align: center;
			height: 35px;
			
		}
		.title{
			padding-left: 10px;
		}
	}
</style>
